package com.yycwxt.modules.admin.user;


import com.yycwxt.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class UserService {

    private final UserMapper userMapper;

    public UserService(@Autowired UserMapper userMapper){
        this.userMapper = userMapper;
    }

    @Transactional
    public int update(String code, String username,String type, Integer id){
        return userMapper.update(code, username, type, id);
    }

    public User findByCode(String code, String password){
        return userMapper.selectByCode(code, password);
    }

    @Transactional
    public int updatePassword(String code, String username, String password){
        return userMapper.updatePassword(code, username, password);
    }
}
